package com.wx.wxpush.controller;

import com.wx.wxpush.entiy.TempData;
import com.wx.wxpush.entiy.TemplateData;
import com.wx.wxpush.mapper.PushersMapper;
import com.wx.wxpush.service.PushService;
import com.wx.wxpush.util.ResultVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author chentianfa
 * @date 2022/8/23
 */
@Slf4j
@Controller
@RequestMapping("/wxpushs")
public class PushsController {

    @Autowired
    private PushersMapper pushersMapper;
    @Autowired
    private PushService pushService;

    @Autowired
    private CronController cronController;


    @GetMapping ("/push")
    @ResponseBody
    public ResultVO pusher(HttpServletRequest request){
        List<String> list=new ArrayList<>();
       ResultVO ss= cronController.ipAddress(request);
//        list=pushersMapper.selectAllOpenid();
//        System.out.println(list+"listtttt");
//        for(String s:list){
//            pushService.goodMorning(s);
//        }

        return ResultVO.ok(ss.getData());
    }
//    @GetMapping ("/push1")
//    @ResponseBody
//    public ResultVO pushe(@RequestParam("openid") String openid){
//        TempData list=pushersMapper.selectByOpenid(openid);
//        return ResultVO.ok(list);
//        }



}
